//
// Copyright (C) 2011 - 2013  Steve Channell steve.channell@cepheis.com
//
// This file is part of Cephei.QL, an open-source library wrapper 
// arround QuantLib http://quantlib.org/
//
// Cephei.QL is open source software: you can redistribute it and/or modify it
// under the terms of the license.  You should have received a
// copy of the license along with this program; if not, please email
// <support@cepheis.com>. The license is also available online at
// <http://cepheis.com/license.htm>.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.  See the license for more details.
//
// Version 2.2 with QuantLib 1.2.1
//#include "stdafx.h"
#include "MixedLinearMonotonicParabolic.h"
using namespace Cephei::QL::Math::Interpolations;
#include <gen/QL/Math/Interpolations/MixedLinearCubicInterpolation.h>
#undef HANDLE
#undef ABSTRACT
#undef STRUCT
Cephei::QL::Math::Interpolations::CMixedLinearMonotonicParabolic::CMixedLinearMonotonicParabolic (boost::shared_ptr<QuantLib::MixedLinearMonotonicParabolic>& childNative, Object^ owner) : CMixedLinearCubicInterpolation(CMixedLinearMonotonicParabolic::typeid)
{
#ifdef HANDLE
	_phMixedLinearMonotonicParabolic = NULL;
#endif
	_ppMixedLinearMonotonicParabolic = &childNative;
    _ppMixedLinearCubicInterpolation = new boost::shared_ptr<QuantLib::MixedLinearCubicInterpolation> (boost::dynamic_pointer_cast<QuantLib::MixedLinearCubicInterpolation> (*_ppMixedLinearMonotonicParabolic));
}
Cephei::QL::Math::Interpolations::CMixedLinearMonotonicParabolic::CMixedLinearMonotonicParabolic (QuantLib::MixedLinearMonotonicParabolic& childNative, Object^ owner) : CMixedLinearCubicInterpolation(CMixedLinearMonotonicParabolic::typeid)
{
#ifdef HANDLE
	_phMixedLinearMonotonicParabolic = NULL;
#endif
	_ppMixedLinearMonotonicParabolic = new boost::shared_ptr<QuantLib::MixedLinearMonotonicParabolic> (&childNative);
    _ppMixedLinearCubicInterpolation = new boost::shared_ptr<QuantLib::MixedLinearCubicInterpolation> (boost::dynamic_pointer_cast<QuantLib::MixedLinearCubicInterpolation> (*_ppMixedLinearMonotonicParabolic));
    _MixedLinearMonotonicParabolicOwner = owner;
    _MixedLinearCubicInterpolationOwner = owner;
}

Cephei::QL::Math::Interpolations::CMixedLinearMonotonicParabolic::CMixedLinearMonotonicParabolic (CMixedLinearMonotonicParabolic^ copy) : CMixedLinearCubicInterpolation(CMixedLinearMonotonicParabolic::typeid)
{
#ifdef HANDLE
	_phMixedLinearMonotonicParabolic = NULL;
#endif
	if (copy->HasNative() != NULL)
    {
		_ppMixedLinearMonotonicParabolic = new boost::shared_ptr<QuantLib::MixedLinearMonotonicParabolic> (copy->GetShared());
        _ppMixedLinearCubicInterpolation = new boost::shared_ptr<QuantLib::MixedLinearCubicInterpolation> (boost::dynamic_pointer_cast<QuantLib::MixedLinearCubicInterpolation> (*_ppMixedLinearMonotonicParabolic));
    }
}
Cephei::QL::Math::Interpolations::CMixedLinearMonotonicParabolic::CMixedLinearMonotonicParabolic (PLATFORM::Type^ t) : CMixedLinearCubicInterpolation(CMixedLinearMonotonicParabolic::typeid)
{
#ifdef HANDLE
	_phMixedLinearMonotonicParabolic = NULL;
#endif
	if (!t->IsSubclassOf(CMixedLinearMonotonicParabolic::typeid))
		throw REFNEW Exception ("Invalid base-case init");
}
#ifdef HANDLE
Cephei::QL::Math::Interpolations::CMixedLinearMonotonicParabolic::CMixedLinearMonotonicParabolic (QuantLib::Handle<QuantLib::MixedLinearMonotonicParabolic>& childNative, Object^ owner)  : CMixedLinearCubicInterpolation(CMixedLinearMonotonicParabolic::typeid)
{
	_phMixedLinearMonotonicParabolic = &childNative;
	_ppMixedLinearMonotonicParabolic = &static_cast<boost::shared_ptr<QuantLib::MixedLinearMonotonicParabolic>>(childNative.currentLink());
    _ppMixedLinearCubicInterpolation = new boost::shared_ptr<QuantLib::MixedLinearCubicInterpolation> (boost::dynamic_pointer_cast<QuantLib::MixedLinearCubicInterpolation> (*_ppMixedLinearMonotonicParabolic));
    _MixedLinearMonotonicParabolicOwner = owner;
}
Cephei::QL::Math::Interpolations::CMixedLinearMonotonicParabolic::CMixedLinearMonotonicParabolic (QuantLib::Handle<QuantLib::MixedLinearMonotonicParabolic> childNative)  : CMixedLinearCubicInterpolation(CMixedLinearMonotonicParabolic::typeid)
{
	_phMixedLinearMonotonicParabolic = &childNative;
	_ppMixedLinearMonotonicParabolic = &static_cast<boost::shared_ptr<QuantLib::MixedLinearMonotonicParabolic>>(childNative.currentLink());
    _ppMixedLinearCubicInterpolation = new boost::shared_ptr<QuantLib::MixedLinearCubicInterpolation> (boost::dynamic_pointer_cast<QuantLib::MixedLinearCubicInterpolation> (*_ppMixedLinearMonotonicParabolic));
}
#endif
#ifdef STRUCT
Cephei::QL::Math::Interpolations::CMixedLinearMonotonicParabolic::CMixedLinearMonotonicParabolic (QuantLib::MixedLinearMonotonicParabolic childNative)  : CMixedLinearCubicInterpolation(CMixedLinearMonotonicParabolic::typeid)
{
#ifdef HANDLE
	_phMixedLinearMonotonicParabolic = NULL;
#endif
	_ppMixedLinearMonotonicParabolic = new boost::shared_ptr<QuantLib::MixedLinearMonotonicParabolic> (new QuantLib::MixedLinearMonotonicParabolic (childNative));
    _ppMixedLinearCubicInterpolation = new boost::shared_ptr<QuantLib::MixedLinearCubicInterpolation> (boost::dynamic_pointer_cast<QuantLib::MixedLinearCubicInterpolation> (*_ppMixedLinearMonotonicParabolic));
}
#endif

Cephei::QL::Math::Interpolations::CMixedLinearMonotonicParabolic::~CMixedLinearMonotonicParabolic ()
{
    if (_ppMixedLinearMonotonicParabolic != NULL)
    {
	    delete _ppMixedLinearMonotonicParabolic;
        _ppMixedLinearMonotonicParabolic = NULL;
    }
}
Cephei::QL::Math::Interpolations::CMixedLinearMonotonicParabolic::!CMixedLinearMonotonicParabolic ()
{
    if (_ppMixedLinearMonotonicParabolic != NULL)
    {
	    delete _ppMixedLinearMonotonicParabolic;
    }
}
QuantLib::MixedLinearMonotonicParabolic& Cephei::QL::Math::Interpolations::CMixedLinearMonotonicParabolic::GetReference ()
{
    if (_ppMixedLinearMonotonicParabolic == NULL) throw REFNEW NativeNullException ();
	return **_ppMixedLinearMonotonicParabolic;
}
boost::shared_ptr<QuantLib::MixedLinearMonotonicParabolic>& Cephei::QL::Math::Interpolations::CMixedLinearMonotonicParabolic::GetShared ()
{
    if (_ppMixedLinearMonotonicParabolic == NULL) throw REFNEW NativeNullException ();
	return *_ppMixedLinearMonotonicParabolic;
}
QuantLib::MixedLinearMonotonicParabolic* Cephei::QL::Math::Interpolations::CMixedLinearMonotonicParabolic::GetPointer ()
{
    if (_ppMixedLinearMonotonicParabolic == NULL) throw REFNEW NativeNullException ();
	return &**_ppMixedLinearMonotonicParabolic;
}
#ifdef HANDLE
QuantLib::Handle<QuantLib::MixedLinearMonotonicParabolic>& Cephei::QL::Math::Interpolations::CMixedLinearMonotonicParabolic::GetHandle ()
{
	if (_phMixedLinearMonotonicParabolic == NULL)
	{
		_phMixedLinearMonotonicParabolic = new Handle<QuantLib::MixedLinearMonotonicParabolic> (*_ppMixedLinearMonotonicParabolic);
	}
	return *_phMixedLinearMonotonicParabolic;
}
#endif
bool Cephei::QL::Math::Interpolations::CMixedLinearMonotonicParabolic::HasNative () 
{
	return (_ppMixedLinearMonotonicParabolic != NULL);
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Factory class

